package cn.ljl.sys.service.impl;

import cn.ljl.basic.service.impl.BaseServiceImpl;
import cn.ljl.sys.domain.DictionaryType;
import cn.ljl.sys.mapper.DictionaryDetailMapper;
import cn.ljl.sys.service.IDictionaryTypeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;


/**
 * 业务实现类：数据字典类型
 */
@Service
public class DictionaryTypeServiceImpl extends BaseServiceImpl<DictionaryType> implements IDictionaryTypeService {

    @Autowired
    private DictionaryDetailMapper dictionaryDetailMapper;


    @Override
    @Transactional
    public void del(Long id) {
        //删除数据字典明细，根据字典类型
        dictionaryDetailMapper.delByTypesId(id);
        //删除数据字典类型
        super.del(id);
    }

    @Override
    @Transactional
    public void patchDelete(List<Long> ids) {
        //批量删除数据字典明细，根据数据字典类型
        dictionaryDetailMapper.patchDeleteByTypesId(ids);
        //批量删除数据字典类型
        super.patchDelete(ids);
    }
}
